<template>
  <div>
    <el-button :loading="$store.state.isLoading" size="mini" @click="gotoLink()" type="primary">跳转新页面</el-button>
    <el-button :loading="$store.state.isLoading" size="mini" @click="openWindow()" type="primary">打开新窗口</el-button>

     <el-form-item label="选项：">
          <el-col :span="24" style="margin-bottom:15px" v-for="(item,i) in edit_data.content_arr" :key="i">
            <el-col :span="18">
              <el-input type="text" :rows="6" clearable placeholder="请输入" v-model="edit_data.content_arr[i]" autocomplete="off">
                <span slot="prepend">选项{{i + 1}}</span>
              </el-input>
            </el-col>
            <el-button :loading="$store.state.isLoading" @click="edit_data.content_arr.splice(i,1)" style="margin-left:15px" type="danger">删除</el-button>
          </el-col>

          <el-col :span="24">
            <el-button :loading="$store.state.isLoading" @click="edit_data.content_arr.push('')" type="success">添加选项</el-button>
          </el-col>
        </el-form-item>
  </div>
</template>
<script>
export default {
  name: "page_text",
  data () {
    return {
    };
  },
  components: {
  },
  methods: {
    gotoLink (item) {
      var url = `/index/shop/event?action=${item.id}`;
      this.$store.commit("addbreadcrumbs", {
        title: "会员商城",
        url: url
      });
      this.$router.push(url);
    },
    openWindow (item) {
      sessionStorage.setItem("title", this.$store.state.title);
      sessionStorage.setItem("parentTitle", this.$store.state.parentTitle);
      let routeData = this.$router.resolve({
        path: "/index/shop/addproduct",
        query: { id: id }
      });
      window.open(routeData.href, "_blank");
    },
  },
}
</script>
<style lang="scss" scoped>
</style>